package queries;

import java.sql.SQLException;
import java.sql.Statement;

import entitys.Type;
import enums.Result;
/**
 * Add new type to ccrm.type
 * @author Dima
 *
 */
public class AddTypeQuery {
	
	public static Result exe(Type type,java.sql.Connection conn)
	{
		Statement stmt;
		try {
			stmt = conn.createStatement();
			stmt.executeUpdate("INSERT INTO `ccrm`.`type` (`name`) VALUES ('"+type.getTypeName()+"');");
			return Result.OK;
			
		} catch (SQLException e) {	return Result.ERROR;}
		
		
	}


}
